package com.bwie.controller;
import com.bwie.pojo.GroupActive;
import com.bwie.service.GroupActiveService;
import com.bwie.service.Impl.GroupActiveServiceImpl;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

/**
* (t_group_active)表控制层
*
* @author xxxxx
*/
@RestController
@RequestMapping("/prod/active")
public class GroupActiveController {
/**
* 服务对象
*/
    @Autowired
    private GroupActiveService groupActiveService;

    /**
     * 活动列表
     * @param pageInfoVo
     * @return
     */
    @PostMapping(value = "/getGroupActiveList")
    public R getGroupList(
            @RequestBody PageInfoVo pageInfoVo
    ){
        return groupActiveService.getGroupActiveList(pageInfoVo);
     }

    /**
     * 活动列表添加
     * @param groupActive
     * @return
     */
     @PostMapping(value = "addGroupActive")
    public R addGroupActive(
        @RequestBody GroupActive groupActive
     ){
        return groupActiveService.addGroupActive(groupActive);
     }

    /**
     * 活动修改
     * @param groupActive
     * @return
     */
    @PostMapping(value = "/updateActive")
    public R updateActive(
         @RequestBody GroupActive groupActive
    ){
         return groupActiveService.updateActive(groupActive);
    }

    /**
     * 活动删除
     * @param activeId
     * @return
     */
    @PostMapping(value = "/deleteActive/{activeId}")
    public R deleteActive(
            @PathVariable("activeId") Integer activeId
    ){
        return groupActiveService.deleteActive(activeId);
    }

    /**
     * 获取活动名称
     * @return
     */
    @PostMapping(value = "/selectGroupActive")
    public R selectGroupActive(){
        return groupActiveService.selectGroupActive();
    }
}
